package com.tianyi.primeval.registry.specialeffects;

import com.tianyi.primeval.registry.PLSpecialEffectsRegistry;
import com.tianyi.primeval.specialattacks.Blowing;
import com.tianyi.primeval.specialattacks.HuanRen;
import com.tianyi.primeval.specialattacks.Zheshei;
import mods.flammpfeil.slashblade.capability.slashblade.ISlashBladeState;
import mods.flammpfeil.slashblade.event.SlashBladeEvent;
import mods.flammpfeil.slashblade.registry.specialeffects.SpecialEffect;
import mods.flammpfeil.slashblade.util.KnockBacks;
import net.minecraft.util.RandomSource;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@Mod.EventBusSubscriber
public class Primevalt extends SpecialEffect {

    public Primevalt() {
        super(1, true, true);
    }

    @SubscribeEvent
    public static void blaze(SlashBladeEvent.UpdateEvent event) {
        ISlashBladeState state = event.getSlashBladeState();
        if (state.hasSpecialEffect(PLSpecialEffectsRegistry.PRIMEVALT.getId())) {
            if (!(event.getEntity() instanceof Player)) {
                return;
            }

            if (!event.isSelected())
                return;

            Player player = (Player) event.getEntity();
            int level = player.experienceLevel;
                if (!player.hasEffect(MobEffects.HEALTH_BOOST)) {
                    player.addEffect(new MobEffectInstance(MobEffects.NIGHT_VISION, 300, 0));
                }
                player.addEffect(new MobEffectInstance(MobEffects.FIRE_RESISTANCE, 300, 0));
                player.addEffect(new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, 300, 0));
                player.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, 300, 0));
                }
            }
        }